package com.itcast.consumer.controller;


import com.itcast.consumer.domain.request.SetmealPageReqDTO;
import com.itcast.consumer.domain.response.SetmealDetailResDTO;
import com.itcast.consumer.domain.response.SetmealPageResDTO;
import com.itcast.consumer.service.ISetmealService;
import com.jzo2o.common.model.PageResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 套餐表 前端控制器
 * </p>
 *
 * @author author
 * @since 2024-11-05
 */
@RestController
@RequestMapping("/consumer/setmeal")
public class SetmealConsumerController {

    @Autowired
    private ISetmealService setmealService;
    @GetMapping("/pageQuery")
    @ApiOperation("小程序端获取套餐分页")
    public PageResult<SetmealPageResDTO> pageQuery(SetmealPageReqDTO setmealPageReqDTO) {
        return setmealService.pageQuery(setmealPageReqDTO);
    }

    @GetMapping("/findDetail/{id}")
    @ApiOperation("根据id查询套餐信息")
    public SetmealDetailResDTO findDetail(@PathVariable Integer id) {
        return setmealService.findDetail(id);
    }
}
